Skip to main content

SetHyperlink

Adds a hyperlink to the specified range.

Syntax

expression.SetHyperlink(sRange, sAddress, subAddress, sScreenTip, sTextToDisplay);

expression - A variable that represents a ApiWorksheet class.

Parameters

NameRequired/OptionalData typeDefaultDescription
sRangeRequiredstringThe range where the hyperlink will be added to.
sAddressRequiredstringThe link address.
subAddressRequiredstringThe link subaddress to insert internal sheet hyperlinks.
sScreenTipRequiredstringThe screen tip text.
sTextToDisplayRequiredstringThe link text that will be displayed on the sheet.

Returns

This method doesn't return any data.

Example

This example adds a hyperlink to the specified range.

var oWorksheet = Api.GetActiveSheet();
oWorksheet.SetHyperlink("A1", "https://api.onlyoffice.com/docbuilder/basic", "Api ONLYOFFICE", "ONLYOFFICE for developers");